import {useSelector} from "react-redux";
import {Reducer} from "@renderer/redux/store";
import {Avatar, Button} from "antd";
import { UserOutlined } from '@ant-design/icons';
import {UserSliceState} from "@renderer/redux/userSlice";

function LoginAvatar(props) {

  const handleClick = ()=>{
    console.log('测试')
  }
  let {isLogin} = useSelector<Reducer,UserSliceState>(state=>state.user)

  let showAvatat = <Avatar></Avatar>

  let button = <Button type="primary" size="large" onClick={handleClick}>注册/登录</Button>

let content =null;
if(isLogin){
  content = showAvatat
}
else {
  content = button
}

  return (
    <>{content}</>
  );
}

export default LoginAvatar;
